home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / ControlStrip.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  7.8 KB  |  240 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        ControlStrip.h
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    ControlStrip 1.4
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1992-1999 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CONTROLSTRIP__
  18. #define __CONTROLSTRIP__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __MENUS__
  25.     #include <Menus.h>
  26. #endif
  27.  
  28. #ifndef __DIALOGS__
  29.     #include <Dialogs.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. /*********************************************************************************************
  56.  
  57.     messages passed to the modules
  58.  
  59. *********************************************************************************************/
  60. enum {
  61.     sdevInitModule                = 0,                            /* initialize the module*/
  62.     sdevCloseModule                = 1,                            /* clean up before being closed*/
  63.     sdevFeatures                = 2,                            /* return feature bits*/
  64.     sdevGetDisplayWidth            = 3,                            /* returns the width of the module's display*/
  65.     sdevPeriodicTickle            = 4,                            /* periodic tickle when nothing else is happening*/
  66.     sdevDrawStatus                = 5,                            /* update the interface in the Control Strip*/
  67.     sdevMouseClick                = 6,                            /* user clicked on the module's display area in the Control Strip*/
  68.     sdevSaveSettings            = 7,                            /* saved any changed settings in module's preferences file*/
  69.     sdevShowBalloonHelp            = 8                                /* puts up a help balloon, if the module has one to display*/
  70. };
  71.  
  72. /*********************************************************************************************
  73.  
  74.     Features supported by the module.  If a bit is set, it means that feature is supported.
  75.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  76.  
  77. *********************************************************************************************/
  78. enum {
  79.     sdevWantMouseClicks            = 0,                            /* notify the module of mouseDown events*/
  80.     sdevDontAutoTrack            = 1,                            /* call the module to do mouse tracking*/
  81.     sdevHasCustomHelp            = 2,                            /* module provides its own help messages*/
  82.     sdevKeepModuleLocked        = 3                                /* module needs to be locked in the heap*/
  83. };
  84.  
  85. /*********************************************************************************************
  86.  
  87.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  88.     If a bit is set, the module can request that a specific function is performed by
  89.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  90.     for future use by Apple, and should be set to zero.
  91.  
  92. *********************************************************************************************/
  93. enum {
  94.     sdevResizeDisplay            = 0,                            /* resize the module's display*/
  95.     sdevNeedToSave                = 1,                            /* need to save changed settings, when convenient*/
  96.     sdevHelpStateChange            = 2,                            /* need to update the help message because of a state change*/
  97.     sdevCloseNow                = 3                                /* close a module because it doesn't want to stay around*/
  98. };
  99.  
  100.  
  101. /*********************************************************************************************
  102.  
  103.     miscellaneous
  104.  
  105. *********************************************************************************************/
  106. enum {
  107.     sdevFileType                = FOUR_CHAR_CODE('sdev')        /* module's file type*/
  108. };
  109.  
  110. enum {
  111.     sdevMenuItemMark            = 0xA5                            /* 'o': 'checkmark' to use in popup menus*/
  112. };
  113.  
  114.  
  115. /*    direction values for SBDrawBarGraph*/
  116.  
  117. enum {
  118.     BarGraphSlopeLeft            = -1,                            /* max end of sloping bar graph is on the left*/
  119.     BarGraphFlatRight            = 0,                            /* max end of flat bar graph is on the right*/
  120.     BarGraphSlopeRight            = 1                                /* max end of sloping bar graph is on the right*/
  121. };
  122.  
  123. /*********************************************************************************************
  124.  
  125.     utility routines to provide standard interface elements and support for common functions
  126.  
  127. *********************************************************************************************/
  128. EXTERN_API( Boolean )
  129. SBIsControlStripVisible            (void)                                                        TWOWORDINLINE(0x7000, 0xAAF2);
  130.  
  131. EXTERN_API( void )
  132. SBShowHideControlStrip            (Boolean                 showIt)                                THREEWORDINLINE(0x303C, 0x0101, 0xAAF2);
  133.  
  134. EXTERN_API( Boolean )
  135. SBSafeToAccessStartupDisk        (void)                                                        TWOWORDINLINE(0x7002, 0xAAF2);
  136.  
  137. EXTERN_API( short )
  138. SBOpenModuleResourceFile        (OSType                 fileCreator)                        THREEWORDINLINE(0x303C, 0x0203, 0xAAF2);
  139.  
  140. EXTERN_API( OSErr )
  141. SBLoadPreferences                (ConstStr255Param         prefsResourceName,
  142.                                  Handle *                preferences)                        THREEWORDINLINE(0x303C, 0x0404, 0xAAF2);
  143.  
  144. EXTERN_API( OSErr )
  145. SBSavePreferences                (ConstStr255Param         prefsResourceName,
  146.                                  Handle                 preferences)                        THREEWORDINLINE(0x303C, 0x0405, 0xAAF2);
  147.  
  148. EXTERN_API( void )
  149. SBGetDetachedIndString            (StringPtr                 theString,
  150.                                  Handle                 stringList,
  151.                                  short                     whichString)                        THREEWORDINLINE(0x303C, 0x0506, 0xAAF2);
  152.  
  153. EXTERN_API( OSErr )
  154. SBGetDetachIconSuite            (Handle *                theIconSuite,
  155.                                  short                     theResID,
  156.                                  unsigned long             selector)                            THREEWORDINLINE(0x303C, 0x0507, 0xAAF2);
  157.  
  158. EXTERN_API( short )
  159. SBTrackPopupMenu                (const Rect *            moduleRect,
  160.                                  MenuHandle             theMenu)                            THREEWORDINLINE(0x303C, 0x0408, 0xAAF2);
  161.  
  162. EXTERN_API( short )
  163. SBTrackSlider                    (const Rect *            moduleRect,
  164.                                  short                     ticksOnSlider,
  165.                                  short                     initialValue)                        THREEWORDINLINE(0x303C, 0x0409, 0xAAF2);
  166.  
  167. EXTERN_API( OSErr )
  168. SBShowHelpString                (const Rect *            moduleRect,
  169.                                  StringPtr                 helpString)                            THREEWORDINLINE(0x303C, 0x040A, 0xAAF2);
  170.  
  171. EXTERN_API( short )
  172. SBGetBarGraphWidth                (short                     barCount)                            THREEWORDINLINE(0x303C, 0x010B, 0xAAF2);
  173.  
  174. EXTERN_API( void )
  175. SBDrawBarGraph                    (short                     level,
  176.                                  short                     barCount,
  177.                                  short                     direction,
  178.                                  Point                     barGraphTopLeft)                    THREEWORDINLINE(0x303C, 0x050C, 0xAAF2);
  179.  
  180. EXTERN_API( void )
  181. SBModalDialogInContext            (ModalFilterUPP         filterProc,
  182.                                  short *                itemHit)                            THREEWORDINLINE(0x303C, 0x040D, 0xAAF2);
  183.  
  184. /* The following routines are available in Control Strip 1.2 and later. */
  185. EXTERN_API( OSErr )
  186. SBGetControlStripFontID            (short *                fontID)                                THREEWORDINLINE(0x303C, 0x020E, 0xAAF2);
  187.  
  188. EXTERN_API( OSErr )
  189. SBSetControlStripFontID            (short                     fontID)                                THREEWORDINLINE(0x303C, 0x010F, 0xAAF2);
  190.  
  191. EXTERN_API( OSErr )
  192. SBGetControlStripFontSize        (short *                fontSize)                            THREEWORDINLINE(0x303C, 0x0210, 0xAAF2);
  193.  
  194. EXTERN_API( OSErr )
  195. SBSetControlStripFontSize        (short                     fontSize)                            THREEWORDINLINE(0x303C, 0x0111, 0xAAF2);
  196.  
  197. EXTERN_API( OSErr )
  198. SBGetShowHideHotKey                (short *                modifiers,
  199.                                  unsigned char *        keyCode)                            THREEWORDINLINE(0x303C, 0x0412, 0xAAF2);
  200.  
  201. EXTERN_API( OSErr )
  202. SBSetShowHideHotKey                (short                     modifiers,
  203.                                  unsigned char             keyCode)                            THREEWORDINLINE(0x303C, 0x0213, 0xAAF2);
  204.  
  205. EXTERN_API( OSErr )
  206. SBIsShowHideHotKeyEnabled        (Boolean *                enabled)                            THREEWORDINLINE(0x303C, 0x0214, 0xAAF2);
  207.  
  208. EXTERN_API( OSErr )
  209. SBEnableShowHideHotKey            (Boolean                 enabled)                            THREEWORDINLINE(0x303C, 0x0115, 0xAAF2);
  210.  
  211. /* The following routines are available in Control Strip 1.4 and later. */
  212. EXTERN_API( short )
  213. SBHitTrackSlider                (const Rect *            moduleRect,
  214.                                  short                     ticksOnSlider,
  215.                                  short                     initialValue,
  216.                                  Boolean *                hit)                                THREEWORDINLINE(0x303C, 0x0616, 0xAAF2);
  217.  
  218.  
  219.  
  220. #if PRAGMA_STRUCT_ALIGN
  221.     #pragma options align=reset
  222. #elif PRAGMA_STRUCT_PACKPUSH
  223.     #pragma pack(pop)
  224. #elif PRAGMA_STRUCT_PACK
  225.     #pragma pack()
  226. #endif
  227.  
  228. #ifdef PRAGMA_IMPORT_OFF
  229. #pragma import off
  230. #elif PRAGMA_IMPORT
  231. #pragma import reset
  232. #endif
  233.  
  234. #ifdef __cplusplus
  235. }
  236. #endif
  237.  
  238. #endif /* __CONTROLSTRIP__ */
  239.  
  240.